#include "ALPGFTT.h"

CALPGFTT::CALPGFTT()
{
}

CALPGFTT::CALPGFTT(CALStepItem* pStepItem)
{
	m_pStepItem = pStepItem;
}

CALPGFTT::~CALPGFTT()
{
}


void CALPGFTT::test()
{

}
void CALPGFTT::convert()
{
	if (m_pStepItem == NULL) return;

	try
	{
		CALSIPGFTT* pStepItem = (CALSIPGFTT*)m_pStepItem;

		if (pStepItem != NULL)
		{
			int maxCorners = pStepItem->GetItemMaxCorners();
			double qualityLevel = pStepItem->GetItemQualityLevel();
			double minDistance = pStepItem->GetItemMinDistance();
			int blockSize = pStepItem->GetItemBlockSize();
			bool useHarrisDetector = pStepItem->GetItemUseHarrisDetector();
			double k = pStepItem->GetItemK();

			//int maxCorners = 1000;
			//double qualityLevel = 0.01;
			//double minDistance = 1;
			//int blockSize = 3;
			//bool useHarrisDetector = false;
			//double k = 0.04;

			std::vector<KeyPoint> keyPoints;
			Ptr<GFTTDetector> fast = GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, k);
			fast->detect(m_srcMat, keyPoints);

			drawKeypoints(m_srcMat, keyPoints, m_dstMat, Scalar::all(255), DrawMatchesFlags::DEFAULT);

			SetDstType(AL_DST_Mat_One);
		}

	}
	catch (...)
	{

	}
}

void CALPGFTT::convert(const Mat &src, Mat &dst)
{

}